package com.education.welco.service.impl;


import com.education.common.utils.Convert;
import com.education.welco.mapper.TSchoolMapper;
import com.education.welco.pojo.JrSchool;
import com.education.welco.pojo.TSchool;
import com.education.welco.service.ITSchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学校 服务层实现
 *
 * @author d
 * @date 2020-05-08
 */
@Service
public class TSchoolServiceImpl implements ITSchoolService {

    @Autowired
    private TSchoolMapper tSchoolMapper;

    /**
     * 查询学校信息
     *
     * @param id 学校ID
     * @return 学校信息
     */
    @Override
    public TSchool selectTSchoolById(Integer id) {
        return tSchoolMapper.selectTSchoolById(id);
    }

    /**
     * 查询学校列表
     *
     * @param tSchool 学校信息
     * @return 学校集合
     */
    @Override
    public List<TSchool> selectTSchoolList(TSchool tSchool) {
        return tSchoolMapper.selectTSchoolList(tSchool);
    }

    /**
     * 新增学校
     *
     * @param tSchool 学校信息
     * @return 结果
     */
    @Override
    public int insertTSchool(TSchool tSchool) {
        return tSchoolMapper.insertTSchool(tSchool);
    }

    /**
     * 修改学校
     *
     * @param tSchool 学校信息
     * @return 结果
     */
    @Override
    public int updateTSchool(TSchool tSchool) {
        return tSchoolMapper.updateTSchool(tSchool);
    }

    /**
     * 删除学校对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTSchoolByIds(String ids) {
        return tSchoolMapper.deleteTSchoolByIds(Convert.toStrArray(ids));
    }

    @Override
    public JrSchool selectTSchoolByIdForjrschool(Integer schoolId) {
        return tSchoolMapper.selectTSchoolByIdForjrschool(schoolId);
    }
}